import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Main {
    private static JFrame mainFrame;

    public static void main(String[] args) {
        // 在事件调度线程中创建和操作GUI组件
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                initializeGUI();
            }
        });
    }

    private static void initializeGUI() {
        // 创建主窗口
        mainFrame = new JFrame("迷宫闯关游戏");
        mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        mainFrame.setMinimumSize(new Dimension(800, 600));
        mainFrame.setLocationRelativeTo(null); // 居中显示
        // 显示主菜单
        Menu.showMainMenu();

        // 显示窗口
        mainFrame.setVisible(true);
    }

    public static JFrame getMainFrame() {
        return mainFrame;
    }
}
